class AIAssistant:
    """AI助手基类"""

    def __init__(self, id, name, type, version, is_online=False, capability_score=0.0):
        self.id = id
        self.name = name
        self.type = type
        self.version = version
        self.is_online = is_online
        self.capability_score = capability_score

    def start_service(self):
        """启动服务"""
        self.is_online = True
        print(f"{self.name} 服务已启动")

    def stop_service(self):
        """停止服务"""
        self.is_online = False
        print(f"{self.name} 服务已停止")

    def assign_task(self, task_description):
        """分配任务"""
        if not self.is_online:
            return f"错误: {self.name} 不在线"
        return f"{self.name} 正在处理任务: {task_description}"

    def get_details(self):
        """获取助手详情"""
        status = "在线" if self.is_online else "离线"
        return {
            "ID": self.id,
            "名称": self.name,
            "类型": self.type,
            "版本": self.version,
            "状态": status,
            "能力评分": self.capability_score
        }


class DataAnalysisAssistant(AIAssistant):
    """数据分析助手子类"""

    def __init__(self, id, name, version, data_processing_speed="中等"):
        super().__init__(id, name, "数据分析", version)
        self.data_processing_speed = data_processing_speed

    def get_details(self):
        details = super().get_details()
        details["数据处理速度"] = self.data_processing_speed
        return details


class ImageGenerationAssistant(AIAssistant):
    """图片生成助手子类"""

    def __init__(self, id, name, version, image_quality="高"):
        super().__init__(id, name, "图片生成", version)
        self.image_quality = image_quality

    def get_details(self):
        details = super().get_details()
        details["图像质量"] = self.image_quality
        return details


class TextGenerationAssistant(AIAssistant):
    """文本生成助手子类"""

    def __init__(self, id, name, version, text_fluency="流畅"):
        super().__init__(id, name, "文本生成", version)
        self.text_fluency = text_fluency

    def get_details(self):
        details = super().get_details()
        details["文本流畅度"] = self.text_fluency
        return details


class TranslationAssistant(AIAssistant):
    """翻译助手子类"""

    def __init__(self, id, name, version, supported_languages=20):
        super().__init__(id, name, "翻译", version)
        self.supported_languages = supported_languages

    def get_details(self):
        details = super().get_details()
        details["支持语言数量"] = self.supported_languages
        return details
